﻿using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using ServiceStack.OrmLite;

namespace OrmLite_Test
{    /// <summary>
     /// 数据库类型
     /// </summary>
    public enum DBType
    {
        /// <summary>
        /// SqlServer数据库
        /// </summary>
        SqlServer,
        /// <summary>
        /// MySql数据库
        /// </summary>
        MySql,
        /// <summary>
        /// Oracle数据库(内置使用 Oracle.ManagedDataAccess 客户端)
        /// </summary>
        Oracle,
        /// <summary>
        /// PostgreSql数据库
        /// </summary>
        PostgreSql,
        /// <summary>
        /// SQLite数据库
        /// </summary>
        SQLite,
    }
    class Program
    {
        static Program()
        {
           
        }
        static void Main(string[] args)
        {
            using (var db = DBLogic.OpenConn())
            {
                if (db.TableExists<Person>())
                {
                    db.DropTable<Person>();
                }
                db.CreateTable<Person>();

                var p = new Person()
                {
                    id = 100,
                    name = "小强",
                    gender = Gender.男
                };

                var r = db.Insert(p);
            }
        }
    }
}
